package ltd.dujiabao.capability.domain.rulemng;

import java.util.Objects;

import ltd.dujiabao.capability.domain.capmng.cap.CapabilityIdentity;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/13 13:55
 * @Desc :
 */
public class SupportIdentity {
    private final CapabilityIdentity identity;
    private final String funcName;

    public SupportIdentity(CapabilityIdentity identity, String funcName) {
        this.identity = identity;
        this.funcName = funcName;
    }

    public CapabilityIdentity getIdentity() {
        return identity;
    }

    public String getFuncName() {
        return funcName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        SupportIdentity that = (SupportIdentity) o;

        if (!Objects.equals(identity, that.identity)) {
            return false;
        }
        return Objects.equals(funcName, that.funcName);
    }

    @Override
    public int hashCode() {
        int result = identity != null ? identity.hashCode() : 0;
        result = 31 * result + (funcName != null ? funcName.hashCode() : 0);
        return result;
    }
}
